import Main from '@/view/main'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

// 角色
// 超级管理员 super_admin
// 服务商管理员 service_admin
// 服务商 service
// 物业管理员 property_admin
// 物业 property


export default [
    {
        path: '/login',
        name: 'login',
        meta: {
            title: 'Login - 登录',
            hideInMenu: true
        },
        component: () =>
            import ('@/pages/login/login.vue')
    },
    {
        path: '/screen',
        name: 'screen',
        meta: {
            title: '大屏幕',
            hideInMenu: true
        },
        component: () =>
            import ('@/pages/statistics/screen')
    },
    {
        path: '/',
        name: '首页',
        redirect: '/home',
        component: Main,
        meta: {
            hideInMenu: true
        },
        children: [
            {
                path: 'home',
                name: 'home',
                meta: {
                    icon: 'help-buoy',
                    title: '工作台',
                    hideInMenu: true
                },
                component: () =>
                    import ('@/pages/statistics/home')
            }
        ]
    },
    {
        path: '/wechat',
        name: 'wechat',
        meta: {
            access: ['wechat'],
            icon: 'md-contacts',
            title: '应用配置'
        },
        component: Main,
        children: [
            {
                path: 'wechatAuth',
                name: 'wechatAuth',
                meta: {
                    access: ['wechatAuth'],
                    icon: 'ios-chatbubbles',
                    title: '公众号授权'
                },
                component: () =>
                    import ('@/pages/wechat/wechatAuth')
            },
            {
                path: 'wechatPay',
                name: 'wechatPay',
                meta: {
                    access: ['wechatPay'],
                    icon: 'logo-chrome',
                    title: '微信支付设置'
                },
                component: () =>
                    import ('@/pages/wechat/wechatPay')
            },
            {
                path: 'alipayConfig',
                name: 'alipayConfig',
                meta: {
                    access: ['alipayConfig'],
                    icon: 'md-settings',
                    title: '支付宝设置'
                },
                component: () =>
                    import ('@/pages/wechat/alipayConfig')
            },
            {
                path: 'terminal',
                name: 'terminal',
                meta: {
                    access: ['terminal'],
                    icon: 'md-settings',
                    title: '小区终端配置'
                },
                component: () =>
                    import ('@/pages/wechat/terminal')
            },
            {
                path: 'wechatMenu',
                name: 'wechatMenu',
                meta: {
                    access: ['wechatMenu'],
                    icon: 'ios-document',
                    title: '配置H5应用'
                },
                component: () =>
                    import ('@/pages/wechat/wechatMenu')
            },
            {
                path: 'source',
                name: 'source',
                meta: {
                    access: ['source'],
                    icon: 'ios-document',
                    title: '数据源配置'
                },
                component: () =>
                    import ('@/pages/wechat/source')
            },
        ]
    },
    {
        path: '/baseinfo',
        name: 'baseinfo',
        meta: {
            access: ['baseinfo'],
            icon: 'ios-people-outline',
            title: '基础数据'
        },
        component: Main,
        children: [
            {
                path: 'boss',
                name: 'boss',
                meta: {
                    access: ['boss'],
                    icon: 'ios-planet-outline',
                    title: '服务商管理'
                },
                component: () =>
                    import ('@/pages/baseinfo/boss')
            },
            {
                path: 'property',
                name: 'property',
                meta: {
                    access: ['property'],
                    icon: 'ios-podium-outline',
                    title: '物业管理'
                },
                component: () =>
                    import ('@/pages/baseinfo/property')
            },
            {
                path: 'houseList',
                name: 'houseList',
                meta: {
                    access: ['houseList'],
                    icon: 'ios-home',
                    title: '小区管理'
                },
                component: () =>
                    import ('@/pages/baseinfo/houseList')
            },
            {
                path: 'roomList',
                name: 'roomList',
                meta: {
                    access: ['roomList'],
                    icon: 'md-home',
                    title: '房屋管理'
                },
                component: () =>
                    import ('@/pages/baseinfo/roomList')
            },
            {
                path: 'ownerList',
                name: 'ownerList',
                meta: {
                    access: ['ownerList'],
                    icon: 'ios-contacts',
                    title: '业主管理'
                },
                component: () =>
                    import ('@/pages/baseinfo/ownerList')
            }
        ]
    },
    {
        path: '/cost',
        name: 'cost',
        meta: {
            access: ['cost'],
            icon: 'logo-yen',
            title: '收费管理'
        },
        component: Main,
        children: [
            {
                path: 'cashier',
                name: 'cashier',
                meta: {
                    access: ['cashier'],
                    icon: 'logo-foursquare',
                    title: '收银台'
                },
                component: () => import ('@/pages/cost/cashier')
            },
            {
                path: 'costType',
                name: 'costType',
                meta: {
                    access: ['costType'],
                    icon: 'ios-disc',
                    title: '费用类型设置'
                },
                component: () =>
                    import ('@/pages/cost/costType')
            },
            {
                path: 'noBill',
                name: 'noBill',
                meta: {
                    access: ['noBill'],
                    icon: 'ios-folder-open-outline',
                    title: '未交账单'
                },
                component: () => import ('@/pages/cost/noBill')
            },
            {
                path: 'alreadyBill',
                name: 'alreadyBill',
                meta: {
                    access: ['alreadyBill'],
                    icon: 'ios-folder-open',
                    title: '已交账单'
                },
                component: () => import ('@/pages/cost/alreadyBill')
            },
            {
                path: 'collection',
                name: 'collection',
                meta: {
                    access: ['collection'],
                    icon: 'ios-create',
                    title: '账单催收'
                },
                component: () =>
                    import ('@/pages/cost/collection')
            },
            {
                path: 'tradingCenter',
                name: 'tradingCenter',
                meta: {
                    access: ['tradingCenter'],
                    icon: 'ios-medal',
                    title: '交易记录'
                },
                component: () =>
                    import ('@/pages/cost/tradingCenter')
            },
            {
                path: 'billPair',
                name: 'billPair',
                meta: {
                    access: ['billPair'],
                    icon: 'ios-medal',
                    title: '对账信息'
                },
                component: () =>
                    import ('@/pages/cost/billPair')
            },
        ]
    },
    {
        path: 'customerManagement',
        name: 'customerManagement',
        meta: {
            access: ['customerManagement'],
            icon: 'ios-bus-outline',
            title: '客户管理'
        },
        component: Main,
        children: [
            {
                path: '/customerManagement/community_user',
                name: 'community_user',
                meta: {
                    access: ['community_user'],
                    icon: 'ios-contacts',
                    title: '客户信息'
                },
                component: () =>
                    import ('@/pages/customerManagement/community_user')
            },
            {
                path: '/customerManagement/community_user_auditing',
                name: 'community_user_auditing',
                meta: {
                    access: ['community_user_auditing'],
                    icon: 'ios-contacts',
                    title: '业主身份审核'
                },
                component: () =>
                    import ('@/pages/customerManagement/community_user_auditing')
            },

        ]
    },
    {
        path: '/news',
        name: 'news',
        meta: {
            access: ['news'],
            icon: 'ios-paper',
            title: '通知公告'
        },
        component: Main,
        children: [
            {
                path: '/news/list',
                name: 'newsList',
                meta: {
                    access: ['newsList'],
                    icon: 'ios-menu',
                    title: '管理公告',
                },
                component: () => import ('@/pages/news/newsList')
            },
            {
                path: '/cmtynews/list',
                name: 'cmtyNewsList',
                meta: {
                    access: ['newEditor'],
                    icon: 'ios-menu',
                    title: '社区公告',
                },
                component: () => import ('@/pages/news/cmtyNewsList')
            },
        ]
    },
    {
        path: '/report',
        name: 'report',
        meta: {
            access: ['report'],
            icon: 'md-construct',
            title: '报事派工'
        },
        component: Main,
        children: [
            {
                path: 'repair',
                name: 'repair',
                meta: {
                    access: ['repair'],
                    icon: 'ios-construct',
                    title: '报事报修'
                },
                component: () =>
                    import ('@/pages/report/repair')
            },
            {
                path: 'advice',
                name: 'advice',
                meta: {
                    access: ['advice'],
                    icon: 'md-bookmarks',
                    title: '投诉建议'
                },
                component: () =>
                    import ('@/pages/report/advice')
            }
        ]
    },
    {
        path: '/patrol',
        name: 'patrol',
        meta: {
            access: ['patrol'],
            icon: 'md-eye',
            title: '智能巡更'
        },
        component: Main,
        children: [
            {
                path: 'address',
                name: 'address',
                meta: {
                    hideInMenu: true,
                    access: ['address'],
                    icon: 'md-flag',
                    title: '巡更地点'
                },
                component: () =>
                    import ('@/pages/patrol/address')
            },
            {
                path: 'route',
                name: 'route',
                meta: {
                    access: ['route'],
                    icon: 'md-bicycle',
                    title: '巡更路线'
                },
                component: () =>
                    import ('@/pages/patrol/route')
            },
            {
                path: 'info',
                name: 'info',
                meta: {
                    hideInMenu: true,
                    access: ['info'],
                    icon: 'md-text',
                    title: '巡更详情'
                },
                component: () =>
                    import ('@/pages/patrol/info')
            },
            {
                path: 'patrolRecord',
                name: 'patrolRecord',
                meta: {
                    access: ['patrolRecord'],
                    icon: 'md-text',
                    title: '巡更记录'
                },
                component: () =>
                    import ('@/pages/patrol/record')
            },
        ]
    },
    {
        path: '/doorSystem',
        name: 'doorSystem',
        meta: {
            access: ['doorSystem'],
            icon: 'ios-bus-outline',
            title: '智能门禁'
        },
        component: Main,
        children: [
            {
                path: 'access',
                name: 'access',
                meta: {
                    access: ['access'],
                    icon: 'ios-bus',
                    title: '通行记录'
                },
                component: () =>
                    import ('@/pages/doorSystem/access')
            },
            {
                path: 'brand',
                name: 'brand',
                meta: {
                    access: ['brand'],
                    icon: 'ios-bus',
                    title: '品牌管理'
                },
                component: () =>
                    import ('@/pages/doorSystem/brand')
            },
            {
                path: 'guard',
                name: 'guard',
                meta: {
                    access: ['guard'],
                    icon: 'ios-bus',
                    title: '门禁DTU'
                },
                component: () =>
                    import ('@/pages/doorSystem/guard')
            },
            {
                path: 'facial_access_control',
                name: 'facial_access_control',
                meta: {
                    access: ['facial_access_control'],
                    icon: 'ios-bus',
                    title: '人脸门禁'
                },
                component: () =>
                    import ('@/pages/doorSystem/facial_access_control')
            },
        ]
    },
    {
        path: '/parking',
        name: 'parking',
        meta: {
            access: ['parking'],
            icon: 'logo-vimeo',
            title: '停车场管理'
        },
        component: Main,
        children: [
            {
                path: 'parking_lot',
                name: 'parking_lot',
                meta: {
                    access: ['parking_lot'],
                    icon: 'md-car',
                    title: '停车场'
                },
                component: () =>
                    import ('@/pages/parking/parking_lot')
            },
            {
                path: 'road',
                name: 'road',
                meta: {
                    access: ['road'],
                    icon: 'md-swap',
                    title: '出入记录'
                },
                component: () =>
                    import ('@/pages/parking/parking_record')
            },
            {
                path: 'parking_lot_manage',
                name: 'parking_lot_manage',
                meta: {
                    access: ['parking_lot'],
                    icon: 'md-car',
                    title: '停车场管理'
                },
                component: () =>
                    import ('@/pages/parking/parking_lot_manage')
            },
        ]
    },
    {
        path: '/deviceManagement',
        name: 'deviceManagement',
        meta: {
            access: ['deviceManagement'],
            icon: 'md-nuclear',
            title: '设备管理与巡检'
        },
        component: Main,
        children: [
            {
                path: 'ledger',
                name: 'ledger',
                meta: {
                    access: ['ledger'],
                    icon: 'ios-menu',
                    title: '设备台账'
                },
                component: () => import ('@/pages/deviceManagement/ledger')
            },
            {
                path: 'routing',
                name: 'routing',
                meta: {
                    access: ['routing'],
                    icon: 'ios-menu',
                    title: '设备表单'
                },
                component: () => import ('@/pages/deviceManagement/routing')
            },
            {
                path: 'plan-record',
                name: 'plan-record',
                meta: {
                    access: ['plan-record'],
                    icon: 'ios-menu',
                    title: '设备巡检记录',
                },
                component: () => import ('@/pages/deviceManagement/plan-record')
            },
            {
                path: 'patrol-plan',
                name: 'patrol-plan',
                meta: {
                    access: ['patrol-plan'],
                    icon: 'ios-menu',
                    title: '设备巡检计划'
                },
                component: () => import ('@/pages/deviceManagement/patrol-plan')
            },
            {
                path: 'responsible',
                name: 'responsible',
                meta: {
                    access: ['responsible'],
                    icon: 'ios-menu',
                    title: '设备责任人'
                },
                component: () => import ('@/pages/deviceManagement/responsible')
            },
            {
                path: 'form-maker',
                name: 'form-maker',
                meta: {
                    access: ['form-maker'],
                    hideInMenu: true
                },
                component: () => import ('@/pages/deviceManagement/form-maker')
            },
        ]
    },
    {
        path: '/material',
        name: 'material_management',
        meta: {
            access: ['material_management'],
            icon: 'md-paper',
            title: '物资管理'
        },
        component: Main,
        children: [
            {
                path: '/material/warehouse_setup',
                name: 'warehouse_setup',
                meta: {
                    access: ['warehouse_setup'],
                    icon: 'ios-menu',
                    title: '仓库设置',
                },
                component: () => import ('@/pages/material/warehouse')
            },
            {
                path: '/material/vendor_settings',
                name: 'vendor_settings',
                meta: {
                    access: ['vendor_settings'],
                    icon: 'ios-menu',
                    title: '供应商设置',
                },
                component: () => import ('@/pages/material/supplier')
            },
            {
                path: '/material/material_settings',
                name: 'material_settings',
                meta: {
                    access: ['material_settings'],
                    icon: 'ios-menu',
                    title: '物资设置',
                },
                component: () => import ('@/pages/material/material')
            },
            {
                path: '/material/purchasing_requisition',
                name: 'purchasing_requisition',
                meta: {
                    access: ['purchasing_requisition'],
                    icon: 'ios-menu',
                    title: '采购申请',
                },
                component: () => import ('@/pages/material/purchasing_requisition')
            },
            {
                path: '/material/in_stock',
                name: 'in_stock',
                meta: {
                    access: ['in_stock'],
                    icon: 'ios-menu',
                    title: '物资入库',
                },
                component: () => import ('@/pages/material/in_stock')
            },
            {
                path: '/material/out_stock',
                name: 'out_stock',
                meta: {
                    access: ['out_stock'],
                    icon: 'ios-menu',
                    title: '物资出库',
                },
                component: () => import ('@/pages/material/out_stock')
            },
            {
                path: '/material/inventory',
                name: 'inventory',
                meta: {
                    access: ['inventory'],
                    icon: 'ios-menu',
                    title: '物资盘点',
                },
                component: () => import ('@/pages/material/inventory')
            },
        ]
    },
    {
        path: '/statistics',
        name: 'statistics',
        meta: {
            access: ['statistics'],
            icon: 'md-aperture',
            title: '综合统计'
        },
        component: Main,
        children: [
            {
                path: 'owner',
                name: 'owner',
                meta: {
                    access: ['owner'],
                    icon: 'ios-menu',
                    title: '住户统计'
                },
                component: () =>
                    import ('@/pages/statistics/pages/owner')
            },
            {
                path: 'room',
                name: 'room',
                meta: {
                    access: ['room'],
                    icon: 'ios-card',
                    title: '房屋统计'
                },
                component: () =>
                    import ('@/pages/statistics/pages/room')
            },
            {
                path: 'pay',
                name: 'pay',
                meta: {
                    access: ['pay'],
                    icon: 'ios-card',
                    title: '缴费统计'
                },
                component: () =>
                    import ('@/pages/statistics/pages/pay')
            },
        ]
    },
    {
        path: '/contract',
        name: 'contract',
        meta: {
            access: ['contract'],
            icon: 'md-paper',
            title: '合同管理'
        },
        component: Main,
        children: [
            {
                path: '/contract/contract',
                name: 'contractInfo',
                meta: {
                    access: ['contractInfo'],
                    icon: 'ios-menu',
                    title: '合同信息',
                },
                component: () => import ('@/pages/contract/contract')
            },
            {
                path: '/contract/matterAndFunds',
                name: 'matterAndFunds',
                meta: {
                    hideInMenu: true,
                    access: ['matterAndFunds'],
                    icon: 'ios-menu',
                    title: '合同详情',
                },
                component: () => import ('@/pages/contract/matterAndFunds')
            },
            {
                path: '/contract/category',
                name: 'category',
                meta: {
                    access: ['category'],
                    icon: 'ios-menu',
                    title: '合同类别',
                },
                component: () => import ('@/pages/contract/category')
            },
            {
                path: '/contract/mechanism',
                name: 'mechanism',
                meta: {
                    access: ['mechanism'],
                    icon: 'ios-menu',
                    title: '机构管理',
                },
                component: () => import ('@/pages/contract/mechanism')
            },
            {
                path: '/contract/library',
                name: 'library',
                meta: {
                    access: ['library'],
                    icon: 'ios-menu',
                    title: '标准合同文库',
                },
                component: () => import ('@/pages/contract/library')
            },
        ]
    },
    {
        path: '/baseinfoConfig',
        name: 'baseinfoConfig',
        meta: {
            access: ['baseinfoConfig'],
            icon: 'ios-people-outline',
            title: '基础配置'
        },
        component: Main,
        children: [
            {
                path: 'recharge',
                name: 'recharge',
                meta: {
                    access: ['recharge'],
                    icon: 'ios-planet-outline',
                    title: '短信充值'
                },
                component: () =>
                    import ('@/pages/baseinfoConfig/recharge')
            },
            {
                path: 'property_config',
                name: 'property_config',
                meta: {
                    access: ['property_config'],
                    icon: 'ios-podium-outline',
                    title: '物业推送配置'
                },
                component: () => import ('@/pages/baseinfoConfig/property_config')
            },
            {
                path: 'print',
                name: 'print',
                meta: {
                    access: ['print'],
                    icon: 'ios-print',
                    title: '打印机配置'
                },
                component: () =>
                    import ('@/pages/baseinfoConfig/print')
            }
        ]
    },
    {
        path: '/systemConfig',
        name: 'systemConfig',
        meta: {
            access: ['systemConfig'],
            icon: 'md-aperture',
            title: '系统管理'
        },
        component: Main,
        children: [
            {
                path: 'parameter',
                name: 'parameter',
                meta: {
                    access: ['parameter'],
                    icon: 'ios-menu',
                    title: '参数配置'
                },
                component: () => import ('@/pages/systemConfig/parameter')
            },
            {
                path: 'system',
                name: 'system',
                meta: {
                    access: ['system'],
                    icon: 'ios-menu',
                    title: '社区应用管理'
                },
                component: () =>
                    import ('@/pages/systemConfig/system')
            },
            {
                path: 'couponList',
                name: 'couponList',
                meta: {
                    access: ['couponList'],
                    icon: 'ios-card',
                    title: '第三方优惠券'
                },
                component: () =>
                    import ('@/pages/systemConfig/couponList')
            },
            {
                path: 'menuConfig',
                name: 'menuConfig',
                meta: {
                    access: ['menuConfig'],
                    icon: 'ios-document',
                    title: '菜单管理'
                },
                component: () =>
                    import ('@/pages/systemConfig/menuConfig')
            },
            {
                path: 'roleConfig',
                name: 'roleConfig',
                meta: {
                    access: ['roleConfig'],
                    icon: 'ios-document',
                    title: '角色管理'
                },
                component: () =>
                    import ('@/pages/systemConfig/roleConfig')
            },
            {
                path: 'smsInfo',
                name: 'smsInfo',
                meta: {
                    access: ['smsInfo'],
                    icon: 'ios-document',
                    title: '短信详情'
                },
                component: () =>
                    import ('@/pages/systemConfig/smsInfo')
            }
        ]
    },
    {
        path: '/userManagement',
        name: 'userManagement',
        meta: {
            access: ['userManagement'],
            icon: 'ios-people',
            title: '用户管理'
        },
        component: Main,
        children: [
            {
                path: 'userList',
                name: 'userList',
                meta: {
                    access: ['userList'],
                    icon: 'ios-contacts',
                    title: '账号管理'
                },
                component: () =>
                    import ('@/pages/userManagement/userList')
            }
        ]
    },
    {
        path: '/manageHR',
        name: 'manageHR',
        meta: {
            access: ['manageHR'],
            icon: 'md-people',
            title: '人事管理'
        },
        component: Main,
        children: [
            {
                path: 'organization',
                name: 'organization',
                meta: {
                    access: ['organization'],
                    icon: 'md-people',
                    title: '企业通讯录'
                },
                component: () =>
                    import ('@/pages/manageHR/organization')
            },
        ]
    },
    /*{
        path: '/page',
        name: 'page',
        meta: {
            access: ['page'],
            icon: 'ios-people-outline',
            title: '其他',
            hideInMenu: true
        },
        component: Main,
        children: [
            {
                path: 'recharge',
                name: 'recharge',
                meta: {
                    access: ['recharge'],
                    icon: 'ios-planet-outline',
                    title: '充值'
                },
                component: () =>
                    import ('@/pages/page/recharge')
            }
        ]
    },*/
    {
        path: '/401',
        name: 'error_401',
        meta: {
            hideInMenu: true
        },
        component: () =>
            import ('@/pages/error-page/401.vue')
    },
    {
        path: '/500',
        name: 'error_500',
        meta: {
            hideInMenu: true
        },
        component: () =>
            import ('@/pages/error-page/500.vue')
    },
    {
        path: '*',
        name: 'error_404',
        meta: {
            hideInMenu: true
        },
        component: () =>
            import ('@/pages/error-page/404.vue')
    }
]
